let layer,$;
layui.use(['layer','jquery'],function () {
    layer=layui.layer,$=layui.jquery;
    $('#register').click(function () {
        let username=$('#username').val();
        let password=$('#password').val();
        let confirmpassword=$('#confirmpassword').val();
        if(confirmpassword!=password){
            layer.msg('两次输入的密码不一致！',function () {});
            return;
        }
        let email=$('#email').val();
        //console.log("username=%s,password=%s",username,password);
        //定义固定盐
        //将输入的明文密码与固定盐进行混淆
        //针对混淆后的密码进行MD5加密
        let user={
            username:username,
            password:password,
            email:email
        }
        $.post('user/RegisterUser',user,function (data) {
            if(data.code==200){
                console.log(data);
                layer.msg("注册成功",{icon:6},function () {
                    //location.href="service/initService";
                });
            }else{
                layer.msg(data.msg,function () {});
            }

        },'json');
    });
})